namespace PickGold.Charting
{
    using System;
    using System.ComponentModel;
    using System.Drawing;
    using System.Security.Permissions;
    using System.Web;

    [DefaultProperty("Name"), SRDescription("DescriptionAttributeNamedImage_NamedImage"), AspNetHostingPermission(SecurityAction.InheritanceDemand, Level=AspNetHostingPermissionLevel.Minimal), AspNetHostingPermission(SecurityAction.LinkDemand, Level=AspNetHostingPermissionLevel.Minimal)]
    public class NamedImage : ChartNamedElement
    {
        private System.Drawing.Image _image;
        private string _name;

        public NamedImage()
        {
            this._name = string.Empty;
        }

        public NamedImage(string name, System.Drawing.Image image)
        {
            this._name = string.Empty;
            this._name = name;
            this._image = image;
        }

        protected override void Dispose(bool disposing)
        {
            if (disposing && (this._image != null))
            {
                this._image.Dispose();
                this._image = null;
            }
            base.Dispose(disposing);
        }

        [Bindable(false), SRDescription("DescriptionAttributeNamedImage_Image")]
        public System.Drawing.Image Image
        {
            get
            {
                return this._image;
            }
            set
            {
                this._image = value;
            }
        }

        [Bindable(false), SRDescription("DescriptionAttributeNamedImage_Name")]
        public override string Name
        {
            get
            {
                return this._name;
            }
            set
            {
                this._name = value;
            }
        }
    }
}

